const ValueObject = require('../../shared/valueObject/VelueObject')
const R = require('ramda')
class Account extends ValueObject {
  account
  password
  constructor(data) {
    super({
      account: { required: true, message: '账号不能为空' },
      password: { required: true, message: '密码不能为空' },
    })
    Object.assign(this, R.pick(['account', 'password'], data))
  }
  static create(data) {
    return new Account(data)
  }
}

module.exports = Account
